package lxh.com.union.logic_business.present;

import com.lzy.okgo.OkGo;

import lxh.com.union.frame.mvp.BasePresent;
import lxh.com.union.logic_business.model.bean.HomePageBean;
import lxh.com.union.logic_business.model.net.INetCallBack;
import lxh.com.union.logic_business.model.net.MyCallBack;
import lxh.com.union.logic_business.model.net.UrlConstant;
import lxh.com.union.logic_business.ui.mvpview.IHomePageView;
import lxh.com.union.logic_business.util.ToastUtils;

/**
 * Created by Administrator on 2017/11/28.
 */

public class HomePagePresent extends BasePresent<IHomePageView> {

    public void loadHomePagedata(){
        OkGo.<String>get(UrlConstant.HOMEPAGE_DATA)
                .params("modelType", "0")//modelType 模板类型：0：首页,1：海外馆首页 ,2：店铺，3场馆，5：场馆子频道；6：馆活动；7：商城活动；
                .params("channelIidd", "")
                .tag(this).execute(new MyCallBack(HomePageBean.class, new INetCallBack() {
            @Override
            public void success(Object o) {
                getView().getHomePageData((HomePageBean) o);
            }

            @Override
            public void failed(Object o) {
                ToastUtils.showLong(o.toString());
            }
        }));
    }
}
